/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package upc.jfactory.scp.jpa.bean;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Diego
 */
@Entity
@Table(name = "Competencias_X_Postulante", catalog = "DAEPIFS_DB", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "CompetenciasXPostulante.findAll", query = "SELECT c FROM CompetenciasXPostulante c"),
    @NamedQuery(name = "CompetenciasXPostulante.findByCompetenciasalumnoId", query = "SELECT c FROM CompetenciasXPostulante c WHERE c.competenciasXPostulantePK.competenciasalumnoId = :competenciasalumnoId"),
    @NamedQuery(name = "CompetenciasXPostulante.findByPostulanteId", query = "SELECT c FROM CompetenciasXPostulante c WHERE c.competenciasXPostulantePK.postulanteId = :postulanteId")})
public class CompetenciasXPostulante implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected CompetenciasXPostulantePK competenciasXPostulantePK;

    public CompetenciasXPostulante() {
    }

    public CompetenciasXPostulante(CompetenciasXPostulantePK competenciasXPostulantePK) {
        this.competenciasXPostulantePK = competenciasXPostulantePK;
    }

    public CompetenciasXPostulante(int competenciasalumnoId, int postulanteId) {
        this.competenciasXPostulantePK = new CompetenciasXPostulantePK(competenciasalumnoId, postulanteId);
    }

    public CompetenciasXPostulantePK getCompetenciasXPostulantePK() {
        return competenciasXPostulantePK;
    }

    public void setCompetenciasXPostulantePK(CompetenciasXPostulantePK competenciasXPostulantePK) {
        this.competenciasXPostulantePK = competenciasXPostulantePK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (competenciasXPostulantePK != null ? competenciasXPostulantePK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompetenciasXPostulante)) {
            return false;
        }
        CompetenciasXPostulante other = (CompetenciasXPostulante) object;
        if ((this.competenciasXPostulantePK == null && other.competenciasXPostulantePK != null) || (this.competenciasXPostulantePK != null && !this.competenciasXPostulantePK.equals(other.competenciasXPostulantePK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "upc.jfactory.scp.jpa.bean.CompetenciasXPostulante[competenciasXPostulantePK=" + competenciasXPostulantePK + "]";
    }

}
